// 封装获取频道列表的逻辑
   // 频道列表 
 
   import {
    useState, useEffect

} from 'react'
   import { getChannels } from '@/apis/acticle'
function  useChannels() {
    const [channels, setChannels] = useState([])
    useEffect(async () => {
        let res = await getChannels()
        console.log(res);
        setChannels(res.data.channels)
    }, [])
    return {channels}
}

export {useChannels}